<!DOCTYPE html>
<!-- saved from url=(0083)https://passport.mtime.com/member/signin/?redirectUrl=http%3A%2F%2Fwww.mtime.com%2F -->
<html>
<head>
<link href="../assets/js/layer/mobile/need/layer.css"></link>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册登录 - Mtime时光网</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="renderer" content="webkit">
<meta name="env" content="prod">
<meta name="startupDate"
	content="Wed Jul 25 2018 22:39:40 GMT+0800 (CST)">
<meta name="versionDate" content="/passport-node/2018030514105620">
<meta name="360-fullscreen" content="true">
<meta name="x5-fullscreen" content="true">
<meta name="full-screen" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link type="image/x-icon" href="https://static1.mtime.cn/favicon.ico"
	rel="icon">
<link type="image/x-icon" href="https://static1.mtime.cn/favicon.ico"
	rel="shortcut icon">
<link type="image/x-icon" href="https://static1.mtime.cn/favicon.ico"
	rel="bookmark">
<link href="../static/css/public.css" rel="stylesheet">
<link href="../static/css/register.css" rel="stylesheet">
<link href="../static/js/layer/mobile/need/layer.css">
<link href="../static/js/layer/theme/default/layer.css">
<link rel="stylesheet" href="../static/css/mtime-vip.css">
</head>
<body>
	<input type="hidden" id="constScript" data-sitedomain=".mtime.com">
	<noscript>您的浏览器不支持javascript，请开启它。否则将不能正常使用本站</noscript>
	<div>
		<div id="beaderbar" data-headtype="2">
			<div class="headbarout fixed">

				<div page="123.html" id="first"></div>

			</div>
			<div class="headbg"></div>
			<div class="mtimebar" data-hang="hangout"></div>
		</div>
	</div>
	<div id="app">
		<div class="regin_out">
			<div class="regin_line"></div>
			<div class="regin_inner fix">
				<div class="regin_left">
					<h5>新会员注册</h5>
					<dl>
						<dd>
							<div class="reg_txt ">
								<input type="text" id="reg_mobile" placeholder="常用手机号">
								<p class="reg_errtxt" id="reg_mobile_msg"></p>
							</div>
						</dd>
						<dd>
							<div class="reg_txt " >
								<input type="password" id="reg_password" maxlength="20"
									placeholder="密码 (6-20位字母与数字、符号组合)">
								<p class="reg_errtxt" id="reg_password_msg">密码强度太低，请使用6-20位字母与数字、符号的组合</p>
								<div class="password_tog " id="showPwdBtn" style="    right: 20px;"></div>
							</div>
						</dd>
						<dd>


							<!-- 注册图片验证 -->
							<div id="login_vco" class="v_m mr6"
								style="cursor: pointer; width: 154px; height: 35px margin-top: ‒10;">
								<input type="text" id="login_vc"
									class="reg_vcodeimg reg_txt reg_vcode" value=""
									placeholder="请输入验证码" />
							</div>


						</dd>
						<dd>
							<div class="reg_txt">
								<input type="text" id="reg_smscode" placeholder="短信验证码">
								<p class="reg_errtxt" id="reg_smscode_msg"></p>
								<a id="reg_smscodeBtn" style="width: 120px;" class="get_telcode"><input 
								value="获取短信验证码" id="clickButton" style="padding-top: 7px;" onclick="clickButton(this)"></a>
							</div>
						</dd>
						<dd>
							<div class="reg_selsex" id="sexRegion">
								性别：<span class="checkend"><input data-sex="1" type="radio" name="sex" value="1" checked="checked"
									data-selector="sex" class="reg_checkbox"></input>男<em
									class="ico_female"></em></span><span><input data-sex="2" type="radio" name="sex" value="2"
									data-selector="sex" class="reg_checkbox"></input>女<em
									class="ico_male"></em></span>
								<p id="sexErrorMsg" style="display: none;">请选择性别!</p>
								<input type="hidden" id="hidSexValue">
							</div>
						</dd>
						<dd>
							<div class="bind_pro">
								<span id="reg_policy" class="on"></span><a
									href="http://feature.mtime.com/help/policy.htm" target="_blank">已同意《Mtime时光网服务条款》</a>
							</div>
						</dd>
						<dt class="reg_btn">
							<a id="mobileRegisterBtn" class="btn_blue">注 册</a>
						</dt>
					</dl>
				</div>



				<div class="regin_right">
					<h5>会员登录</h5>
					<form id="loginForm">
						<dl id="loginEmail">
							<dd>
								<div class="reg_txt ">
									<input type="text" id="loginEmailText" name="email"
										placeholder="输入邮箱 / 手机号码">
									<p class="reg_errtxt" id="loginEmailText_msg">请使用邮箱 / 手机号或
										万达电影 账号登录</p>
								</div>
							</dd>
							<dd>
								<div class="reg_txt">
									<input type="password" id="hidepassword" class="c_a5"
										style="display: none;"><input type="password"
										id="loginPasswordText" placeholder="请输入密码" autocomplete="off">
									<p class="reg_errtxt" id="hidepassword_msg">密码错误</p>
								</div>
							</dd>
							<dd id="login_vcode_hidden" style="display: none;"></dd>
							<dd>
								<div class="bind_pro">
									<a id="forget_password"
										href="https://passport.mtime.com/member/signin/?redirectUrl=http%3A%2F%2Fwww.mtime.com%2F#"
										class="fr">忘记密码</a><a href="javascript:;" id="smsLoginBT"
										data-login="loginWayChange" class="fl">短信验证码登录</a>
								</div>
							</dd>
							<dd>
								<p class="err_txt" id="login_errtxt"></p>
							</dd>
							<dt class="reg_btn">
								<a id="loginButton" class="btn_blue">登 录</a>
							</dt>
						</dl>
					</form>


					<!-- 手机验证 -->
					<div id="smsLoginBox" style="display: none;">
						<dl>
							<dd>
								<div class="reg_txt ">
									<input type="text" name="mobile" maxlength="11"
										id="smsLoginIpt" placeholder="请输入手机号">
									<p class="reg_errtxt"></p>
								</div>
							</dd>
							<dd>

								<!-- 手机登录图片验证 -->
								<!-- <input type="text" id="login_vcodea" class="reg_vcodeimg reg_txt reg_vcode" value="" placeholder="请输入验证码"/>
							<div id="login_vcodes"></div> -->


							</dd>
							<dd>
								<div class="reg_txt ">
									<input type="text" name="sms" id="smsIpt" placeholder="短信验证码">
									<p class="reg_errtxt"></p>
									<a href="javascript:;" class="get_telcode" id="smsGet">获取验证码</a>
								</div>
							</dd>
							<dd>
								<div class="bind_pro">
									<a href="javacript:;" id="loginEmailBT"
										data-login="loginWayChange" class="fl">帐号密码登录</a><i class="fr"
										style="color: #6f6f6f;">未注册手机验证后自动登录</i>
								</div>
							</dd>
							<dd>
								<p class="err_txt"></p>
							</dd>
							<dt class="reg_btn">
								<a class="btn_blue" id="smsLoginButton">登 录</a>
							</dt>
						</dl>
					</div>
					<dl class="regin_log3 fix">
						<dd>
							<a
								href="https://passport.mtime.com/unitelogin/dispatch/weixin/web/"
								class="weixin"></a><a
								href="https://passport.mtime.com/unitelogin/dispatch/qq/web/?r=http%3A%2F%2Fwww.mtime.com%2F"
								class="qq"></a><a
								href="https://passport.mtime.com/unitelogin/dispatch/weibo/web/?r=http%3A%2F%2Fwww.mtime.com%2F"
								class="sina"></a>
						</dd>
					</dl>
				</div>
			</div>
		</div>
	</div>
	<div>
		<div>
			<div class="footout">
				<span class="topline"></span>
				<div class="footinner fix">
					<div class="fotlogo">
						<dl>
							<dt>
								<a href="http://www.mtime.com/" title="Mtime时光网">Mtime时光网</a>
							</dt>
							<dd class="fix">
								<a href="https://app.mokahr.com/apply/mtime">加入我们</a><a
									href="http://feature.mtime.com/help/contact.htm" class="ml30">联系我们</a>
							</dd>
							<dd class="fix">
								<a href="http://group.mtime.com/help/">站务论坛</a><a
									href="http://my.mtime.com/reportError/" class="ml30">问题反馈</a>
							</dd>
							<dd class="fix">
								<a href="http://feature.mtime.com/help/rules.htm">社区准则</a><a
									href="http://www.mtime.com/sitemap.htm" class="ml30">网站地图</a>
							</dd>
							<dd class="fix">
								<a href="http://feature.mtime.com/help/privacy.htm">隐私政策</a><a
									href="http://en.mtime.com/" class="ml30">English</a>
							</dd>
						</dl>
						<i class="line"></i>
					</div>
					<div class="fotmap">
						<dl style="width: 42px;">
							<dt>栏目</dt>
							<dd>
								<a href="http://news.mtime.com/">新闻</a>
							</dd>
							<dd>
								<a href="http://theater.mtime.com/">影院</a>
							</dd>
							<dd>
								<a href="http://mall.mtime.com/">商城</a>
							</dd>
							<dd>
								<a href="http://www.mtime.com/community/">社区</a>
							</dd>
						</dl>
						<dl style="width: 185px;">
							<dt>推荐</dt>
							<dd>
								<a href="http://movie.mtime.com/recent/">观影指南</a><a
									href="http://movie.mtime.com/boxoffice/" class="ml30">电影票房</a>
							</dd>
							<dd>
								<a href="http://news.mtime.com/conversation/">时光对话</a><a
									href="http://video.mtime.com/trailer/" class="ml30">新片预告</a>
							</dd>
							<dd>
								<a href="http://movie.mtime.com/all/list/index.html">特色榜单</a><a
									href="http://my.mtime.com/app/quiz/" class="ml30">电影猜猜猜</a>
							</dd>
							<dd>
								<a href="http://news.mtime.com/fun/">全球拾趣</a><a
									href="http://my.mtime.com/app/card/" class="ml30">卡片大富翁</a>
							</dd>
						</dl>
						<dl>
							<dt>关注我们</dt>
							<dd>
								<a
									href="https://passport.mtime.com/unitelogin/dispatch/weibo/web/?r=http%3A%2F%2Fwww.mtime.com%2F"
									target="_blank" class="sina" title="微博">微博</a>
							</dd>
							<dd>
								<a id="aWeiXinPicButton" href="javascript:void(0)"
									class="weixin" title="微信">微信</a>
							</dd>
							<dd>
								<a href="http://www.mtime.com/rss/" target="_blank" class="rss"
									title="RSS">RSS</a>
							</dd>
						</dl>
						<i class="line"></i>
						<div id="divWeiXinPicContainer" class="my_layer none">
							<em class="l_arrow">&nbsp;</em>
							<div class="inner p15">
								<i></i>
								<p>扫描二维码，微信实时关注时光网</p>
							</div>
						</div>
					</div>
					<div class="fotweek" id="fotweek">
						<dl>
							<dt class="fix">
								<span class="fr">第212期</span><strong>时光周刊</strong>
							</dt>
							<dd>
							</dd>
							<dd class="input">
								<input id="iptEMail" type="text" value="邮箱地址" class="c_a5">
								<a id="btnSubscribe" href="javascript:void(0)">订阅</a>
							</dd>
						</dl>
					</div>
					<div class="fothr">
						<dl>
							<dt>
								<strong>手机购票</strong> 方便 实惠
							</dt>
							<dd>
								<a href="http://feature.mtime.com/mobile/" target="_blank"><i></i></a>
							</dd>
							<dd>扫描二维码 下载客户端</dd>
						</dl>
					</div>
				</div>
			</div>
			<div class="db_foot">
				<p>
					<span>举报中心电话：4006118118 举报中心邮箱：service@mtime.com </span><br> <span>北京动艺时光网络科技有限公司</span>Copyright
					2006-2018 Mtime.com Inc. All rights reserved.<br> <a
						href="http://feature.mtime.com/help/icp.htm" target="_blank">京ICP证050715号</a><a
						href="http://feature.mtime.com/help/videolicence.htm"
						target="_blank" class="mr12">网络视听许可证0108265号</a><a
						href="http://feature.mtime.com/help/network.htm" target="_blank"
						class="mr12">网络文化经营许可证</a><a
						href="http://feature.mtime.com/help/tvlicence.htm" target="_blank"
						class="mr12">广播电视节目制作经营许可证(京)字第1435号</a><a
						href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502032542"
						target="_blank" class="beian_container"><span class="beian"></span><span>京公网安备：11010502032542号</span></a>
				</p>
				<div class="credible">
					<a
						href="http://v.pinpaibao.com.cn/authenticate/cert/?site=www.mtime.com&amp;at=business"
						class="aqLogo" target="_blank"></a>
				</div>
			</div>
		</div>
	</div>
	
	<script src="../static/js/test.js"></script>
	<script src="../static/js/jquery-3.3.1.js"></script>
	<script src="../assets/js/jquery.form.js"></script>
	<script src="../assets/js/layer/layer.js"></script>
	<!-- 验证码 -->
	<script src="../static/js/gVerify.js"></script>
	<script>
		/* var verifyCode = new GVerify("login_vcodes"); */
		var verifyCode = new GVerify("login_vco");
		var code;
			
		$(function() {
			frist();
			
		})

		//用户密码登录
		$("#loginButton").click(function() {
			var userName = $("#loginEmailText").val();
			var password = $("#loginPasswordText").val();
			var userName = $("#loginEmailText").val();
			var password = $("#loginPasswordText").val();
			if ($.trim(userName) == "" || $.trim(password) == "") {//$.trim删除前后空格
				alert("用户名和密码不能为空");
				return false;
			}
			login(userName,password);
		})
		
		function login(userName,password){
			$.ajax({//jquery.form.js
				url : "/moviesMaven/login2.htm",
				async : true,
				data : {
					"userName" : userName,
					"password" : password
				},
				dataType : "json",
				success : function(data) {
					if (data.success) {//登录成功
						layer.msg("登录成功");
						location.href = "movieshop.html"
					} else {
						layer.msg("登录失败");
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					console.log(textStatus + ":" + XMLHttpRequest.status);
				}
			})
		}

		function frist() {
			var liftPage = $("#first").attr("page");
			$("#first").load(liftPage);
		};

		$("#smsLoginBT").click(function() {
			$("#smsLoginBox").attr("style", "display:;");
			$("#loginEmail").attr("style", "display:none");
		})

		$("#loginEmailBT").click(function() {
			$("#loginEmail").attr("style", "display:");
			$("#smsLoginBox").attr("style", "display:none;");

		})

		/* $("#smsLoginButton").click(function(){
			var res = verifyCode.validate(document.getElementById("login_vcodea").value);
			if(res){
				alert("验证正确");
			}else{
				alert("验证码错误");
			}
		}) */

		
		
		//注册
		$("#mobileRegisterBtn").click(function() {
			var password = $("#reg_password").val();
			var userName = $("#reg_mobile").val();
			var sex = $('input[name="sex"]:checked').val();
			cheak_();
			chesk_phone();
			
			if(cheak_userName()&&cheak_password()&&cheak_()&&chesk_phone()){
				console.log("注册填写成功");
				$.ajax({
					url:"/moviesMaven/user/selectUser.htm",
					data:{"userName":userName,"password":password},
					dataType:"json",
					success:function(data){
						if(data.success){
							$.ajax({
								url:"/moviesMaven/user/addUsers.htm",
								data:{"userName":userName,"password":password,"sex":sex},
								dataType:"json",
								success:function(data){
									layer.msg(data.message, {
										time:2000
									},function(){
										login(userName,password);
									})
								}
							})
						}else{
							layer.msg("此账号密码已注册")
						}
					}
				})
			}
		})

	    $("#clickButton").click(function(){
			//发送短信验证
			var phone = $("#reg_mobile").val();
		  	 //var code ="123456"; 
	    	if(cheak_userName){
				$.ajax({
			 		url:"/moviesMaven/user/sendMsg.htm",
			 		type:"post",
			 		data:{"phone":phone},
			 		dataType:"json",
			 		success : function(data) {
			 			code = data.code
			 			console.log(code);
			 		},
			 	});
	    	}else{
	    		layer.msg("请先输入手机号码")
	    	}
		});	
		
		$("#reg_mobile").blur(function(){
			cheak_userName()
		})
		$("#reg_password").blur(function(){
			cheak_password()
		})
		
		//账号
		function cheak_userName() {
			var userName = $("#reg_mobile").val();

			console.log(userName.length)

			if (userName.length == 0) {
				layer.msg("请输入手机号")
			} else if (userName.length != 11) {
				layer.msg("请输入正确的手机号")
			}else{
				return true;
			}
			return false;
		}
		
		//密码
		function cheak_password() {
			var password = $("#reg_password").val();


			if (password.length == 0) {
				layer.msg("请输入密码")
			} else if (password.length < 6) {
				layer.msg("请输入正确的密码")
			}else{
				return true;
			}
			return false;
		}
		
		//图片验证码
		function cheak_() {
			var res = verifyCode.validate(document
					.getElementById("login_vc").value);
			if (res) {
				console.log("验证正确");
				return true;
			} else {
				layer.msg("验证码错误");
			}
			return false;
		}
		
		//短信验证倒计时
		function clickButton(obj){
		    var obj = $(obj);
		    obj.attr("disabled","disabled");
		    var time = 60;
		    var set=setInterval(function(){
		    obj.val((--time)+"秒后重新获取");
		    }, 1000);
		    setTimeout(function(){
		    obj.attr("disabled",false).val("获取短信验证码");
		    clearInterval(set);
		    }, 60000);
		}
		
		//手机验证
		function chesk_phone(){
			var a = $("#reg_smscode").val();//用户验证码
			console.log(a)
			if(a==code){
				return true;
			}
			layer.msg("手机验证码错误")
			return false;
		}
		
		$("#showPwdBtn").hover(function(){
			$("#reg_password").attr("type","text")
		},function(){
			$("#reg_password").attr("type","password")
		})
		
		
	</script>
</body>
</html>